<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="UTF-8"/>
<title>运营平台</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="renderer" content="webkit">
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/common.css?v=20170207" />
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/table.css?v=20170117" />
<link type="text/css" rel="stylesheet" href="<?php echo get_style_cdnurl();?>paimai/yunying/css/jquery-ui.css" />
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-1.11.1.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-ui.min.js" type="text/javascript"></script>
 <script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/yunIndex.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery-ym-datePlugin-0.1.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/yunying/js/global.js" type="text/javascript"></script>
<script src="<?php echo get_style_cdnurl();?>paimai/cheshan/js/common.js" type="text/javascript"></script>
<script type="text/javascript" src="<?php echo get_style_cdnurl();?>paimai/yunying/js/jquery.placeholder.min.js"></script>
<script type="text/javascript">
 $(function(){
     $("input").placeholder();
     if (navigator.userAgent.indexOf("Safari") > -1) {
       $("input").css("lineHeight","normal !important");
     };
});
</script>

<style>
    .chenggong1 .paidan{padding-top:30px;}
    .chenggong1 .paidan h6{color:#666;}
    .chenggong1 .paidan h5{color:red;}
    .chenggong1{width: 750px;}
    .chenggong1 .shenhei-btn{margin: 50px 130px 0px; }
    .chenggong1 .msg{height: 130px;}
</style>
</head>
<body>
  <body>
<div class="header">
<div class="headerCo">
<span>你好,<?php echo ($user_info["real_name"]); ?><a href="<?php echo (WEB_URL); ?>Emp/logout">退出</a></span>
<h1><img src="<?php echo get_style_cdnurl();?>paimai/yunying/images/yun_logo.jpg"></h1>
</div>
</div>

  <div class="mian">
    <div class="mianL">
    <dl>
        <dd>
            <a id="menu_sy" href="/Index/index" class="shouye">首页</a>
        </dd>
        <?php foreach ($tree_menu as $key => $value): ?>
          <dd>
            <span id="menu_<?php echo ($value['first_char']); ?>" ><img src="<?php echo get_style_cdnurl();?>paimai/yunying/images/yun_jia.jpg"><?php echo ($value['name']); ?></span>
            <ul style="display: none;">
                <?php if (!empty($value['children'])): ?>
                    <?php foreach ($value['children'] as $k => $v): ?>
                        <li><a id='menu_<?php echo ($v["first_char"]); ?>' href="<?php echo ($v['url']); ?>"><?php echo ($v['name']); ?></a></li>
                    <?php endforeach ?>
                <?php endif ?>
            </ul>
        <?php endforeach ?>
    </dl>
</div>

<?php $menu = 'shgl.csfkgz'; ?>
<?php $menu=json_encode(explode('.', $menu)); ?>
<script>
    $(function () {
        var cur_menu = '<?php echo ($menu); ?>', cur_menu = eval('[' + cur_menu + ']'), cur_menu = cur_menu[0];
        if (cur_menu == "sy") {
            $("#menu_sy").removeClass('shouye').addClass('current');
        }
        $('#menu_' + cur_menu[0]).click();
        $('#menu_' + cur_menu[0]).find("img").attr("src", "http://img1.isou365.cn/paimai/yunying/images/yun_jie.jpg");
        $(".mianL").css("height", $(document).height() - 95);
        $('#menu_' + cur_menu[1]).addClass('current');
    });
</script>

    <div class="mianR">
			<h3 class="yonghu">收款跟踪</h3>
			<div class="yuyue">
				<ul>
					<li onclick="change_search(1);get_list(1)" class="yuCurrent" >待结算</li>
					<li onclick="change_search(2);get_list(2)">待收车款</li>
					<!--<li onclick="change_search(3);get_list(3)">核实车款</li> -->
					<li onclick="change_search(4);get_list(4)">收款失败</li>
					<li onclick="change_search(5);get_list(5)">收款成功</li>
				</ul>
			</div>

			<div class="yuSuo clearfix" style="float:left;">
				<input id="status" name="status" type="hidden" value="<?php echo ((isset($params["status"]) && ($params["status"] !== ""))?($params["status"]):1); ?>"/>
				<select name="location_area" id="la" class="tracking_list1" style="color:#7f7f7f">
					<?php if(count($bc_city) > 1): ?><option value="0">请选择所在地</option><?php endif; ?>
					<?php foreach ($bc_city as $key => $value): ?>
					<option value="<?php echo ($key); ?>"
					<?php if ($key == $location_area): ?>
					selected="selected"
					<?php endif ?>><?php echo ($value); ?></option>
					<?php endforeach ?>
				</select>
				<input type="text"  name="keyword" id="keyword" value="<?php echo ($params["keyword"]); ?>" placeholder="车商电话/车商姓名/拍卖单号" class="suoDian suoDian1" style="width: 220px;"/>
				<select name="pay_mode" id="pay_mode" class="tracking_list1 s1" style="display:none;margin-left: 10px;height: 25px;line-height: 25px;">
					<option value="">全部付款类型</option>
					<?php foreach ($dealer_pay_mode as $key => $value): ?>
					<option value="<?php echo ($key); ?>"
					<?php if ($key == $params['pay_mode']): ?>
					selected="selected"
					<?php endif ?>><?php echo ($value); ?></option>
					<?php endforeach ?>
				</select>
				<select name="pay_status" id="pay_status_1" class="tracking_list1 s2" style="display:none;margin-left: 10px;height: 25px;line-height: 25px;">
					<option value="">全部收款状态</option>
					<?php foreach ($collection_status_wait as $key => $value): ?>
					<option value="<?php echo ($key); ?>"
					<?php if ($key == $params['pay_status']): ?>
					selected="selected"
					<?php endif ?>><?php echo ($value); ?></option>
					<?php endforeach ?>
				</select>
				<select name="pay_status" id="pay_status_2" class="tracking_list1 s3" style="display:none;margin-left: 10px;height: 25px;line-height: 25px;">
					<option value="">全部收款状态</option>
					<?php foreach ($collection_status_verify as $key => $value): ?>
					<option value="<?php echo ($key); ?>"
					<?php if ($key == $params['pay_status']): ?>
					selected="selected"
					<?php endif ?>><?php echo ($value); ?></option>
					<?php endforeach ?>
				</select>
				<select name="pay_status" id="pay_status_3" class="tracking_list1 s4" style="display:none;margin-left: 10px;height: 25px;line-height: 25px;">
					<option value="">全部收款状态</option>
					<?php foreach ($collection_status_failed as $key => $value): ?>
					<option value="<?php echo ($key); ?>"
					<?php if ($key == $params['pay_status']): ?>
					selected="selected"
					<?php endif ?>><?php echo ($value); ?></option>
					<?php endforeach ?>
				</select>
				<input type="button" value="搜索" id="search" class="suoSou" style="width:80px;" />
			</div>

			<div class="listBox" id="listBox">

            </div>
		</div>
	</div>
	<div class="clear"></div>
  </div>

  <script>
	  function get_page(p) {
		  var status = $("#status").val();
		  var url = get_url(status);
		  url += "&p=" + p;
		  $.get("/PayTrack/pay_list?status=" + status, encodeURI(url), function (data) {
			  $("#listBox").html(data);
		  }, "html");
	  }

	  get_list(1);
	  function get_list(status) {
		  change_tabs(status);
		  $("#status").val(status);
		  var url = get_url(status);
		  $.get("/PayTrack/pay_list?status=" + status, url, function (data) {
			  $("#listBox").html(data);
		  }, "html");
	  }

	  function get_url(t) {
		  var url = "";
		  var la = $("#la").val();
		  var keyword = $("#keyword").val();
		  var pay_mode = $("#pay_mode").val();
		  var pay_status = 0;
		  if (t == 2) {
			  pay_status = $("#pay_status_1").val();
		  } else if (t == 3) {
			  pay_status = $("#pay_status_2").val();
		  } else if (t == 4) {
			  pay_status = $("#pay_status_3").val();
		  }
		  if (la > 0) {
			  url += '&la=' + la;
		  }
		  if (keyword) {
			  url += '&keyword=' + keyword;
		  }
		  if (pay_mode) {
			  url += '&pay_mode=' + pay_mode;
		  }
		  if (pay_status) {
			  url += '&pay_status=' + pay_status;
		  }
		  return url;
	  }

	  $('#search').on('click', function () {
		  var status = $("#status").val();
		  get_list(status);
		  // clear_params();
	  });
	  function change_search(st) {
		  var s1 = $(".s1"), s2 = $(".s2"), s3 = $(".s3"), s4 = $(".s4");
		  if (st == 1) {
			  s1.hide();
			  s2.hide();
			  s3.hide();
			  s4.hide();
		  }
		  if (st == 2) {
			  s1.show();
			  s2.show();
			  s3.hide();
			  s4.hide();
		  }
		  if (st == 3) {
			  s1.show();
			  s2.hide();
			  s3.show();
			  s4.hide();
		  }
		  if (st == 4) {
			  s1.show();
			  s2.hide();
			  s3.hide();
			  s4.show();
		  }
		  if (st == 5) {
			  s1.show();
			  s2.hide();
			  s3.hide();
			  s4.hide();
		  }
	  }

	  function change_tabs(status) {
		  if ($("#status").val() != status) {
			  clear_form_params();
		  }
	  }

	  function clear_form_params() {
		  $(':input').not(':button, :submit, :reset, :hidden').val('');
		  if ($("#la option").length > 1) {
			  $("#la").val(0);
		  }
		  if ($("#pay_mode option").length > 1) {
			  $("#pay_mode").val("");
		  }
	  }

	  function dealer_pay_violate(order_id, dealer_id) {
		  var htext = "您确定将此车商置为争议吗?";
		  // text = '<span class="msg">' + msg + '</span>';
		  var html = '<div class="chenggong1" style="height: 260px;">\n\
                <span class="paidan"><h6>' + htext + '</h6>' + '</span>\n\
                <textarea id="violate_remark" name="violate_remark" style="height:100px;width:430px;margin-top:20px;"></textarea><em style="color:red;">&nbsp;*</em>\n\
                <div class="shenhei-btn" style="margin-top:20px;"><input type="button" value="确定" class="determine" />\n\
                <input type="button" value="取消" class="cancel" onclick="colse_hide()" />\n\
                </div></div>';
		  $(".yunBei").css("display", "block");
		  $(document.body).append(html);
		  $(".chenggong1").fadeIn();
		  pay_vialate(order_id, dealer_id);
	  }

	  function pay_vialate(order_id, dealer_id) {
		  $('.determine').click(function () {
			  var violate_remark = $("#violate_remark").val();
			  var post_data = {order_id: order_id, dealer_id: dealer_id, violate_remark: violate_remark};
			  $.post('/PayTrack/dealer_pay_violate', post_data, function (res) {
				  if (res.code == 200) {
					  colse_hide();
					  delay_alert('操作成功!');
					  setTimeout(function () {
						  window.location.reload();
					  }, 500);
				  } else {
					  delay_alert(res.msg);
				  }
			  }, 'json');
			  return false;
		  });
	  }

</script>
 <div class="yunBei"></div>
<div class="loading"></div>
</body>
</html>